import axios from '../utils/request';

class AuthAPI {
  private baseUrl = '/auth';

  // 用户注册
  register(userData: any) {
    return axios.post(`${this.baseUrl}/register`, userData);
  }

  // 用户登录
  login(credentials: any) {
    return axios.post(`${this.baseUrl}/login`, credentials);
  }

  // 获取用户资料
  getProfile() {
    return axios.get(`${this.baseUrl}/profile`);
  }
}

// 导出单例
export default new AuthAPI();

